package Method_01;

import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;

public class Method_01_testing {
	
	private static PollGroup<Integer> pg;
	
	@Test
	public void a_first(){
		pg = new PollGroup<Integer>("Poll Group 1");
		pg.add(new PollableNode<Integer>(pg, 1));
		pg.add(2);
		pg.add(3);
		pg.add(0);
		
		// order matters, but shouldn't, something is wrong with insertion and/or getRightValue
	}
	
	@Test
	public void testOrder() {
		System.out.println(pg);
		
		assertEquals(new Integer(0), pg.getHead().getValue());
		assertEquals(new Integer(1), pg.getHead().right.getValue());
		assertEquals(new Integer(2), pg.getHead().right.right.getValue());
		
		assertEquals(new Integer(2), pg.getTail().getValue());
		assertEquals(new Integer(1), pg.getTail().left.getValue());
		assertEquals(new Integer(0), pg.getTail().left.left.getValue());
	}
	
	@Test
	public void testToLeftOf(){
		assertEquals(new Integer(1), pg.makePoll(pg.ToTheLeftOf(10)));
	}

	@Test
	public void testToRightOf(){
		fail("not implemented yet");
	}
	
	@Test
	public void testLastOf(){
		fail("not implemented yet");
	}
	
	@Test
	public void testFirstOf(){
		fail("not implemented yet");
	}

}
